package com.zhuiyun.project.api.reservation.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhuiyun.project.annotation.OptLog;
import com.zhuiyun.project.api.reservation.entity.TrainingTime;
import com.zhuiyun.project.api.reservation.mapper.TrainingTimeMapper;
import com.zhuiyun.project.api.vipPlan.entity.ActionCount;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.constants.CommonConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName TrainingTimeController
 * @Description TODO
 * @Author xy
 * @Date 2023/12/5 20:14
 **/
@RestController
@Api(tags = "预约时间段接口")
@RequestMapping("/trainingTime")
@Slf4j
public class TrainingTimeController {
    @Resource
    TrainingTimeMapper trainingTimeMapper;

    /*
    * @Author xy
    * @Description todo 查询上午预约时间段
    * @Date 2023/12/5 20:16
    * @Return
    * @param
    */
    @GetMapping("/morning")
    @ApiOperation(value = "动作详细查询")
    @OptLog(modular = "课程管理", type = CommonConstants.SELECT, describe = "动作详细查询")
    public CommonResult morning() {
        QueryWrapper<TrainingTime> queryWrapper = new QueryWrapper();
        List<TrainingTime> list = trainingTimeMapper.selectList(queryWrapper);
        return CommonResult.ok(list);
    }

    /*
    * @Author xy
    * @Description todo 查询下午预约时间段
    * @Date 2023/12/5 20:27
    * @Return
    * @param
    */
    @GetMapping("/afternoon")
    @ApiOperation(value = "动作详细查询")
    @OptLog(modular = "课程管理", type = CommonConstants.SELECT, describe = "动作详细查询")
    public CommonResult afternoon() {
        QueryWrapper<TrainingTime> queryWrapper = new QueryWrapper();
        queryWrapper.in("id", 4, 5, 6);
        List<TrainingTime> list = trainingTimeMapper.selectList(queryWrapper);
        return CommonResult.ok(list);
    }

}
